ROOT_PATH?=$(shell cd $(PWD)/..; pwd)
include $(ROOT_PATH)/Makefile.param

SRC:=$(wildcard *.c)  
OBJ:=$(SRC:%.c=%.o)  

LIB_DIR=../lib/$(ARCH_VERSION)


   
TARGET:=libmongoose.so
TARGETAR=libmongoose.a
 
all: $(TARGET) $(TARGETAR)
 
$(TARGET) : $(OBJ) 
	$(CC) -shared -o $@  $^  -lpthread -lrt -ldl -lm  $(SSL_LIB) -L$(LIB_DIR) 

$(TARGETAR) : $(OBJ)
	$(AR)	-rcs	$(TARGETAR)	$^ 
  
$(OBJ) : %.o:%.c
	$(CC) -Dlinux -D_GNU_SOURCE -std=c99  -DMG_ENABLE_LOG  -g -Wall  -I../include/  -fPIC -c $< -o $@ 

clean:
	rm -f $(OBJ) 
	rm -f tags
